package twu.shubham.biblioteca;


public class bookrecord {

    public int slno;
    public int amt;
    public String bookname ;
    public int actamt;

    public int setValues(int i, int j,String name) {
        slno =i;
        amt=j;
        bookname=name;
        actamt=j;
        return 1;
    }

    /*public int getAmtLeft() {
        if(amt>0)
            return 1;

        return 0;

    }     */

  /*  public int getAct() {
        if(amt<actamt)
            return 1;

        return 0;

    }*/

    public int bookPrint()
    {
        if(slno>0)
        {
            System.out.println(slno +"\t\t" + bookname);
            return 1;
        }
        return 0;
    }

    public int reserveBook()
    {
        if(amt>0)
        {
            System.out.println("Thank You, Your book has been reserved\n");
            System.out.println(slno +"\t"+bookname);
        amt=amt-1;
        return 1;
        }
        System.out.println("This book is not available yet\n");
        return 0;
    }

    public int returnBook()
    {
        if(amt<actamt)
        {
            System.out.println("Thank you for returning the book");
            amt=amt+1;
            return 1;
        }
        System.out.println("Sorry, we can't accept the book");
        return 0;
    }
}

